package com.fhs.test.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "student",autoResultMap = true)
public class Student {

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    private String stuName;

    @TableField(value = "school_id",target = School.class)
    private Integer schoolId;

    @TableField(relation = Relation.MANY_TO_ONE)
    private School school;

    private Integer age;

    private String schoolCode;

    /**
     * 一个人有多个手机号，指定本类的id=对方类的studentId
     */
    @TableField(relation = Relation.ONE_TO_MANY,target = Mobile.class,modelFields = "id",targetFields = "studentId")
    List<Mobile> mobileList;

    @TableField(funField = true,exist = false)
    private Integer stuCount;

    private Date updateTime;

}

